// 封装获取组织架构的请求
import request from '@/utils/request'
/** *
 *
 * 封装获取组织架构数据方法
 * **/
export function getDepartments() {
  return request({
    url: '/company/department'
    // token已经统一注入不用管了
  })
}
// 1封装删除组织架构接口
export function delDepartments(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
// 2 封装新增部门接口
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 3获取企业详情的信息
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 更新部门
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
